package exercise;

import java.util.Scanner;

public class TestScannerString {
	public static void main(String[] args) {
		String str="123dsgfadsgjlafdjhladDWGDFADFADSFADSFDASnhsdaf!@$%@#45324rdsf";
//		Scanner sc=new Scanner(System.in);
//		String str=sc.nextLine();
		int countu=countUpper(str);
		p(countu);
		int countl=countLower(str);
		p(countl);
		int othern=str.length()-countu-countl;
		p(othern);
		int counts=countChar(str,'a');
		p(counts);
	}

	private static int countChar(String str, char c) {
		int n=0;
        for (int i = 0; i < str.length(); i++) {
			if(str.charAt(i)==c)
				n++;
		}
		return n;
	}

	private static int countLower(String str) {
		int n=0;
        for (int i = 0; i < str.length(); i++) {
			if(str.charAt(i)>='a'&&str.charAt(i)<='z')
				n++;
		}
		return n;
	}

	private static int countUpper(String str) {
        int n=0;
        for (int i = 0; i < str.length(); i++) {
			if(str.charAt(i)>='A'&&str.charAt(i)<='Z')
				n++;
		}
		return n;
	}
    static void p(Object o){
    	System.out.println(o);
    }
}
